package com.example.myapplication.adapter

import com.example.myapplication.databinding.ItemDevicesBinding
import com.wakeup.sdk.ble.WeikeBleMgr
import com.wakeup.sdk.ble.ext.connect.ScanDevice

/**
 * @Author:      lsr
 * @CreateDate:  2023/10/7 17:16
 * @Description: 类功能描述说明
 */
class DeviceAdapter : BaseAdapter<ScanDevice, ItemDevicesBinding>(ItemDevicesBinding::inflate) {

    override fun convert(holder: BaseViewHolder<ItemDevicesBinding>, item: ScanDevice) {
        holder.binding.tvName.text = item.bleName
        holder.binding.tvMac.text = item.mac
        holder.binding.tvState.setOnClickListener {
            WeikeBleMgr.connectDevice(item.mac, false, false)
        }
    }
}